using System.Collections.Generic;
using NDomain.Reflection;

namespace NDomain.Reflection
{
    public class ServiceProcessor : BaseClassProcessor
    {
        public override void Process(IClassInfoProvider clazz, IDomainInfo domainInfo)
        {
            IDictionary<string, IAttributeInfoProvider> attributes = AttributesAsDictionary(clazz.GetAttributes());

            if (!attributes.ContainsKey(typeof (ServiceAttribute).FullName)) return;

            domainInfo.NewService(clazz.GetNamespace(), clazz.GetName());
        }
    }
}